package com.fegin.api.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author:RenPu
 * @Date: 2020/8/27 18:41
 * @Version: 1.0
 * @description:
 */

@FeignClient(value = "fegin-provider", url = "www.baidu.com")
public interface IService {

    @GetMapping("/sayHello")
    public String eurekaClientTest(@RequestParam("test") String test);


    @PostMapping("/sayHi")
    public Firend testPostMethond(@RequestBody Firend firend);


    @PostMapping("/sayHiS")
    public String testPostMethond(@RequestBody List<String> stringList);


    /**
     * 模拟超时的接口
     *
     * @param timeout
     * @return
     */
    @GetMapping("/retry")
    public String retry(@RequestParam("timeout") int timeout);


    @GetMapping("/error")
    public String error();
}
